package com.xrtn.mapper;

import com.xrtn.bean.TOrderInfo;
import com.xrtn.page.Page;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface TOrderInfoMapper {
    int deleteByPrimaryKey(Integer orderId);

    int deleteByUserId(Integer userId);

    int deleteByPatientId(Integer patientId);

    int insert(TOrderInfo record);

    int insertSelective(TOrderInfo record);

    TOrderInfo selectByPrimaryKey(Integer orderId);

    TOrderInfo selectByMap(Map<String, Object> params);

    List<TOrderInfo> selectByMaps(Map<String, Object> params);

    List<TOrderInfo> selectOrderListByMap(Map<String, Object> params);

    /**
     * 技师端 - 根据患者查询就诊记录
     *
     * @return
     */
    List<Map<String,Object>> selectPatientList(Map<String,Object> params);

    /**
     * 技师端 - 获取大夫订单总数
     *
     * @param doctorId
     * @return
     */
    int selectDoctorOrderCount(Integer doctorId);

    /**
     * 后台首页统计接口 - 主营收入金额  ||  付款订单数量
     *
     * @return
     */
    Map<String, Object> selectOrderStatistics(Map<String, Object> params);
    /**
     * 后台首页统计接口 - 主营收入金额  ||  付款订单数量
     *
     * @return
     */
    Map<String,Object> selectUserToDayOrderMoney(Map<String, Object> params);

    /**
     * 技师端 - 获取订单详情
     *
     * @return
     */
    Map<String, Object> selectOrderDetail(Map<String, Object> params);

    /**
     * 技师端 - 获取技师业绩列表
     *
     * @param params
     * @return
     */
    List<Map<String, Object>> selectDoctorSaleList(Map<String, Object> params);

    /**
     * 后台 - 查询订单列表
     *
     * @param params
     * @return
     */
    List<Map<String, Object>> selectSysOrderPageList(@Param("page") Page page,@Param("params") Map<String, Object> params);
    List<Map<String, Object>> selectSysOrderSalePageList(@Param("page") Page page,@Param("params") Map<String, Object> params);
    List<Map<String, Object>> selectSysOrderPageLists(@Param("page") Page page,@Param("params") Map<String, Object> params);
    List<Map<String, Object>> selectSysOrderPageTotal(@Param("params") Map<String, Object> params);
    List<Map<String, Object>> selectSysOrderPageOffsetLists(@Param("params") Map<String, Object> params);
    /**
     * 商品分组统计
     *
     * @param params
     * @return
     */
    List<Map<String, Object>> selectGoodsStatic(Map<String, Object> params);

    int updateByPrimaryKeySelective(TOrderInfo record);

    /**
     * 修改代付信息
     * @param record
     * @return
     */
    int updateOtherPayUser(TOrderInfo record);

    int updateByPrimaryKey(TOrderInfo record);

    int updateByPrimaryKeyPayFlag(@Param("payWay")Integer payWay, @Param("payWays")Integer payWays, @Param("orderId")Integer orderId);
}